﻿<telerik:RadWindow x:Class="LeoK.DCI.Views.DCIEditor"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             mc:Ignorable="d" 
                   WindowStartupLocation="CenterScreen"
                   Width="600" Height="500"
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        
        <StackPanel Orientation="Horizontal" Margin="20, 5">
            <Image Height="24" Width="24" Source="/LeoK;component/Resources/btnPrev.png" MouseLeftButtonDown="btnPrev_OnClick" />
            <telerik:RadDatePicker Width="120" HorizontalAlignment="Left" Margin="5" x:Name="datePicker" SelectionChanged="DatePicker_OnSelectionChanged" />
            <Image Height="24" Width="24" Source="/LeoK;component/Resources/btnNext.png" MouseLeftButtonDown="btnNext_OnClick" />
            
            <CheckBox VerticalAlignment="Center" Content="锁定" x:Name="cbkLocked" Margin="10, 0" />
        </StackPanel>

        <telerik:RadCartesianChart Grid.Row="1" x:Name="RadCartesianChart" Margin="10"
                                   MouseLeftButtonDown="LineSeries_MouseLeftButtonDown"
                                   MouseMove="RadCartesianChart_OnMouseMove">
            <telerik:RadCartesianChart.Annotations>
                <telerik:CartesianGridLineAnnotation x:Name="VAGridLineAnnotation" Stroke="Goldenrod" StrokeThickness="1" Axis="{Binding ElementName=VAxis}" />
                <telerik:CartesianGridLineAnnotation x:Name="HAGridLineAnnotation" Stroke="Goldenrod" StrokeThickness="1" Axis="{Binding ElementName=HAxis}" />

                <telerik:CartesianGridLineAnnotation Value="0.03" Stroke="LightSeaGreen" StrokeThickness="0.5" Axis="{Binding ElementName=PrecentVAxis}"/>
                <telerik:CartesianGridLineAnnotation Value="-0.03" Stroke="LightSeaGreen" StrokeThickness="0.5" Axis="{Binding ElementName=PrecentVAxis}"/>
                <telerik:CartesianGridLineAnnotation Value="0.07" Stroke="Red" StrokeThickness="0.5" Axis="{Binding ElementName=PrecentVAxis}"/>
                <telerik:CartesianGridLineAnnotation Value="-0.07" Stroke="Red" StrokeThickness="0.5" Axis="{Binding ElementName=PrecentVAxis}"/>
                <telerik:CartesianGridLineAnnotation Value="0" Stroke="Gray"  StrokeThickness="0.5" Axis="{Binding ElementName=PrecentVAxis}"/>
            </telerik:RadCartesianChart.Annotations>
            
            <telerik:LineSeries x:Name="LineSeries"
                                CategoryBinding="Time"
                                MouseLeftButtonDown="LineSeries_MouseLeftButtonDown"
                                ValueBinding="Value"  >
                <telerik:LineSeries.VerticalAxis>
                    <telerik:LinearAxis x:Name="VAxis" Width="50" LabelFormat="0.00" />
                </telerik:LineSeries.VerticalAxis>
                <telerik:LineSeries.PointTemplate>
                    <DataTemplate>
                        <Ellipse Width="5"
                                 Height="5"
                                 Fill="Green"/>
                    </DataTemplate>
                </telerik:LineSeries.PointTemplate>
            </telerik:LineSeries>
            <telerik:SplineSeries x:Name="slineMA" VerticalAxis="{Binding ElementName=VAxis}"
                                      CategoryBinding="Date"
                                      ValueBinding="Value" >
                <telerik:SplineSeries.StrokeShapeStyle>
                    <Style TargetType="Path">
                        <Setter Property="Stroke" Value="DeepPink"/>
                    </Style>
                </telerik:SplineSeries.StrokeShapeStyle>
            </telerik:SplineSeries>

            <telerik:RadCartesianChart.HorizontalAxis >
                <telerik:DateTimeCategoricalAxis x:Name="HAxis" Height="50"  DateTimeComponent="TimeOfDay" LabelFitMode="Rotate"  LabelInterval="2" LabelFormat="HH:mm" />
            </telerik:RadCartesianChart.HorizontalAxis>
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis Width="50" 
                                    x:Name="PrecentVAxis"
                                    MajorStep="0.01"
                                    HorizontalLocation="Right"
                                    LabelFormat="0.00%"
                                    Minimum="-0.1"
                                    Maximum="0.1" />
            </telerik:RadCartesianChart.VerticalAxis>
            
        </telerik:RadCartesianChart>
    </Grid>
</telerik:RadWindow>
